package com.controller.front;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.entity.Data.PagerData;
import com.service.front.ISingerServiceFront;
import com.service.front.ISpecialServiceFront;
import com.sun.org.apache.xpath.internal.operations.Mult;


@RequestMapping("/special")
@Controller
public class SpecialControllerFront {
	@Autowired
	private ISpecialServiceFront specialServiceFront;
	@Autowired
	private ISingerServiceFront singerServiceFront;
	
   @RequestMapping("/list")
  public String list(Model model,Integer curPage){
	  
	  if(curPage==null){
			curPage = 1;
		}
		//根据页数，查询当前页的数据
		PagerData pd = specialServiceFront.findByPage(curPage, 10);
		model.addAttribute("pd",pd);
		
		List<Map<String, Object>> speciallList=specialServiceFront.list();
		model.addAttribute("special",speciallList);
	  return "special";
	  
  }

   @RequestMapping("/list2")
	   public String list2(Model model,int musicId,int specialId){
	   
	   Map<String, Object> special=specialServiceFront.find(musicId);
	   model.addAttribute("speciaLlist",special);
	   
	   List<Map<String, Object>> specialSp=specialServiceFront.findSpe(specialId);
	   model.addAttribute("specilaSp",specialSp);
   
      return "specialList";
   } 
   
 
   
}
